package main

/* string类型转换*/
import (
	"fmt"
	"strconv"
)

func main() {
	var s1 = "true"

	var b bool

	b, _ = strconv.ParseBool(s1)

	fmt.Printf("b的类型是 :%t,b=%v \n", b, b)

	var s2 = "19"
	num1, _ := strconv.ParseInt(s2, 0, 32)

	var s3 = "19.02"
	num2, _ := strconv.ParseFloat(s3, 64)
	fmt.Print(num1, num2)

	s4 := fmt.Sprintf("%s好好", s1)
	fmt.Print(s4 + "\n")

	a := 10
	s5 := strconv.FormatInt(int64(a), 10)

	fmt.Println(s5)

}
